import matplotlib.pyplot as plt

hours = list(range(24))

def ploter(solar_data, usage_data):
    solar_data = [float(item) for item in solar_data]
    usage_data = [float(item) for item in usage_data]
    print('[debug] [plot]', solar_data)
    plt.plot(hours, solar_data)
    plt.title('Power generate history')
    plt.xlabel('Time (h)')
    plt.ylabel('Power (kW.h)')
    plt.savefig('/etc/nginx/html/src/solar.png')
    
    plt.clf()
    
    print('[debug] [plot]', usage_data)
    plt.plot(hours, usage_data)
    plt.title('Power consume history')
    plt.xlabel('Time (h)')
    plt.ylabel('Power (kW.h)')
    plt.savefig('etc/nginx/html/src/usage.png')
    
    plt.clf()